<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html class="no-js">    
    <head>
        <title>教师主页</title>
        <!-- Bootstrap -->
        <link href="${pageContext.request.contextPath }/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
        <link href="${pageContext.request.contextPath }/bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet" media="screen">
        <link href="${pageContext.request.contextPath }/vendors/easypiechart/jquery.easy-pie-chart.css" rel="stylesheet" media="screen">
        <link href="${pageContext.request.contextPath }/assets/styles.css" rel="stylesheet" media="screen">
		<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
        <script src="${pageContext.request.contextPath }/vendors/modernizr-2.6.2-respond-1.1.0.min.js"></script>
    </head>
<body>
        <div class="navbar navbar-fixed-top">
            <div class="navbar-inner">
                <div class="container-fluid">
                    <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> <span class="icon-bar"></span>
                     <span class="icon-bar"></span>
                     <span class="icon-bar"></span>
                    </a>
                    <a class="brand" href="#">选课系统</a>
                    <div class="nav-collapse collapse">
                        <ul class="nav pull-right">
                            <li class="dropdown">
                                <a href="#" role="button" class="dropdown-toggle" data-toggle="dropdown">
                                    <i class="icon-user">
                                    </i>${sessionScope.teacher.academy.name } ${sessionScope.teacher.name }<i class="caret"></i>

                                </a>
                                <ul class="dropdown-menu">
                                   <li><a tabindex="-1" href="user_logout.action?id=1">退出</a></li>
                                </ul>
                            </li>
                        </ul>
                        <ul class="nav">
                            <li class="active">
                                <a href="#" data-toggle="dropdown" class="dropdown-toggle">查看课程</a>

                            </li>
                            <li class="dropdown">
                                <a  class="dropdown-toggle" href="#" data-toggle="dropdown">新增课程</a>
							    <ul class="dropdown-menu" id="menu1">
								    <li>
								        <a href="teacher_addCourse.action?id=1">新增课程</a>
								    </li>
						        </ul>
						    </li>
                        </ul>
                    </div>
                    <!--/.nav-collapse -->
                </div>
            </div>
        </div>
        <div class="container-fluid">
            <div class="row-fluid">
                <div class="span2" id="sidebar">
                    <ul class="nav nav-list bs-docs-sidenav nav-collapse collapse">
                        <li class="active">
                            <a href="teacher_checkAll.action?id=1">查看全部课程</a>
                        </li>
                        <c:forEach var="course" items="${sessionScope.teacher.courses }">
                            <li>
                                <a href="teacher_checkCourse.action?cid=${course.id }"><i class="icon-chevron-right"></i>${course.name }</a>
                            </li>
                        </c:forEach>
                        <li class="active">
                            <a href="teacher_addCourse.action?id=1"><i class="icon-chevron-right"></i>新增课程</a>
                        </li>
                    </ul>
                </div>
                
                <!--/span-->
                <div class="span10" id="content">				
                <c:if test="${!empty message }">
					<div class="row-fluid">
						<div class="alert alert-success">
							<button type="button" class="close" data-dismiss="alert">&times;</button>
							<h4>提示</h4>
							${message }
						</div>
					</div>
				</c:if>
                    <div class="row-fluid">
                        <!-- block -->
                        <div class="block">
                            <div class="navbar navbar-inner block-header">
                                <div class="muted pull-left">统计</div>
                                <div class="pull-right"><span class="badge badge-warning">${fn:length(sessionScope.teacher.courses) }</span>

                                </div>
                            </div>
                            <div class="block-content collapse in">
                                <c:forEach var="course" items="${sessionScope.teacher.courses }">
                                    <div class="span3">
                                        <div class="chart" data-percent="${course.selected / course.sum * 100}" > 
                                            <fmt:formatNumber type="number" value="${course.selected / course.sum * 100}" pattern="0.0" maxFractionDigits="1"/>
                                            %&nbsp;${course.selected }/${course.sum }
                                        </div>
                                        <div class="chart-bottom-heading"><span class="label label-info">${course.name }</span>
                                        </div>
                                    </div>
                                </c:forEach>
                            </div>
                        </div>
                        <!-- /block -->
                    </div>
                </div>
            </div>
            <hr>
            <footer>
            </footer>
        </div>
        <!--/.fluid-container-->
        <script src="${pageContext.request.contextPath }/vendors/jquery-1.9.1.min.js"></script>
        <script src="${pageContext.request.contextPath }/bootstrap/js/bootstrap.min.js"></script>
        <script src="${pageContext.request.contextPath }/vendors/easypiechart/jquery.easy-pie-chart.js"></script>
        <script src="${pageContext.request.contextPath }/assets/scripts.js"></script>
        <script>
        $(function() {
            // Easy pie charts
            $('.chart').easyPieChart({animate: 1000});
        });
        </script>
    </body>

</html>